using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace EFDataBase.Models.Mapping
{
    public class clientlistMap : EntityTypeConfiguration<clientlist>
    {
        public clientlistMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.openid)
                .HasMaxLength(350);

            this.Property(t => t.area)
                .HasMaxLength(50);

            this.Property(t => t.building)
                .HasMaxLength(50);

            this.Property(t => t.drom)
                .HasMaxLength(50);

            this.Property(t => t.number)
                .HasMaxLength(50);

            this.Property(t => t.state_text)
                .IsFixedLength()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("clientlist");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.openid).HasColumnName("openid");
            this.Property(t => t.area).HasColumnName("area");
            this.Property(t => t.building).HasColumnName("building");
            this.Property(t => t.drom).HasColumnName("drom");
            this.Property(t => t.number).HasColumnName("number");
            this.Property(t => t.time).HasColumnName("time");
            this.Property(t => t.state).HasColumnName("state");
            this.Property(t => t.state_text).HasColumnName("state_text");
        }
    }
}
